summaryrefslogtreecommitdiffstats
path: root/src/org/uic/header/DataBlockType.java
blob: 503c2037a1cb0c1fcd9c4ed5883f2c5a27f218b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package org.uic.header;

import net.gcdc.asn1.datatypes.Asn1Optional;
import net.gcdc.asn1.datatypes.CharacterRestriction;
import net.gcdc.asn1.datatypes.IntRange;
import net.gcdc.asn1.datatypes.RestrictedString;
import net.gcdc.asn1.datatypes.Sequence;
import net.gcdc.asn1.uper.UperEncoder;


/**
 * The DataBlockType.
 * 
 * Data block ready for signing
 * 
 */
@Sequence
public class DataBlockType {
	
	
		/** The data. */
		public SequenceOfDataType data;
		
		/** 
		 * The signing algorithm
		 * Object Identifier of the Algorithm
		 * Number notation:
		 * 
		 *  e.g.:
		 *        	--    DSA SHA224  2.16.840.1.101.3.4.3.1
      	 *          --    DSA SHA248  2.16.840.1.101.3.4.3.2
      	 *          --    ECC         1.2.840.10045.3.1.7
		 *  
		 *  
		 */
		@RestrictedString(CharacterRestriction.ObjectIdentifier)
		@Asn1Optional public String signingAlg;
		
		/** The key id. */
		@IntRange(minValue=1,maxValue=1024)
		@Asn1Optional public Long	keyId;

		/**
		 * Gets the data.
		 *
		 * @return the data
		 */
		public SequenceOfDataType getData() {
			return data;
		}

		/**
		 * Sets the data.
		 *
		 * @param data the new data
		 */
		public void setData(SequenceOfDataType data) {
			this.data = data;
		}

		/**
		 * Gets the signing algorithm
		 * 
		 * Object Identifier of algorithm Algorithm
		 * Number notation:
		 * 
		 *  e.g.:
		 *        	--    DSA SHA224  2.16.840.1.101.3.4.3.1
      	 *          --    DSA SHA248  2.16.840.1.101.3.4.3.2
      	 *          --    ECC         1.2.840.10045.3.1.7
		 *
		 * @return the signing alg
		 */
		public String getSigningAlg() {
			return signingAlg;
		}

		/**
		 * Sets the signing algorithm
		 * 
		 * Object Identifier of the Algorithm
		 * Number notation:
		 * 
		 *  e.g.:
		 *        	--    DSA SHA224  2.16.840.1.101.3.4.3.1
		 *          --    DSA SHA248  2.16.840.1.101.3.4.3.2
		 *          --    ECC         1.2.840.10045.3.1.7 
		 *
		 * @param signingAlgorithm the new signing alg
		 */
		public void setSigningAlg(String signingAlgorithm) {
			this.signingAlg = signingAlgorithm;
		}

		/**
		 * Gets the key id.
		 *
		 * @return the key id
		 */
		public Long getKeyId() {
			return keyId;
		}

		/**
		 * Sets the key id.
		 *
		 * @param keyId the new key id
		 */
		public void setKeyId(Long keyId) {
			this.keyId = keyId;
		}
		
		
		/**
		 * Gets the data for signature.
		 *
		 * The byte array containing the ASN.1 PER UNALIGNED encoded data of the DataBlock
		 *
		 *
		 * @return the data for signature
		 */
		public byte[] getDataForSignature() {
			return UperEncoder.encode(this);

		}
		
		
		  
}